Sub zad()

Dim x As Double, y As Double
x = InputBox("x=")

If x = 0 Then
MsgBox ("x je nula")

Else
y = 1 / x + x + 2
MsgBox ("y=" & y)

End If

End Sub

Sub zad2()

Dim x As Double, y As Double
x = InputBox("x=")

If x < -1 Then
y = 0

ElseIf x < 0 Then
y = 2 * x + 2

ElseIf x < 5 Then
y = x ^ 2 - 4 * x + 3

Else
y = 8
End If

MsgBox ("y=" & y)

End Sub

Sub zad3()
Dim n As Long, broj As String, j As Long
n = InputBox("Unesi broj manji od 20")
If n <= 10 Then
  broj = Choose(n, "jedan", "dva", "tri", "cetiri", "pet", "sest", "sedam", "osam", "devet", "deset")
  
  ElseIf n = 11 Then
  broj = "jedanaest"
  
  ElseIf n = 14 Then
  broj = "cetrnaest"
  
  ElseIf n = 16 Then
  broj = "sesnaest"
  
  Else
  j = n Mod 10
  broj = Choose(j, "jedan", "dva", "tri", "cetiri", "pet", "sest", "sedam", "osam", "devet", "deset") + "naest"
  End If
  MsgBox (broj)
      
End Sub

Sub zad6()
Dim x As Double, y As Double
x = InputBox("x=")
y = InputBox("y=")
x = Abs(x)

If y > 0 Then
   If (x - 0.5) ^ 2 + y ^ 2 <= 0.25 Then
       MsgBox ("tacka je unutar")
       Else
         MsgBox ("tacka je izvan")
    End If
    
    Else
    If x - 1 >= y Then
MsgBox ("tacka je unutar")
       Else
         MsgBox ("tacka je izvan")
         End If
End If

End Sub

Sub zad7()
Dim a As Double, b As Double, x As Double, y As Double, m As Double, t As Double, tx As Double, ty As Double

x = InputBox("x=")
y = InputBox("y=")
tx = InputBox("tx=")
ty = InputBox("ty=")

a = -x
b = -y

m = ((4 * x ^ 2 - x ^ 2 * 3.14 + 2 * x * y) / 4) * 2

If tx < x And ty < y Then
  MsgBox ("Tacka je unutar")
  
  Else
  MsgBox ("tacka je izvan")
  
  End If